<!DOCTYPE html>   
<html lang="en">   
<head>   
  <meta charset="UTF-8">   
  <meta name="viewport" content="width=device-width, initial-scale=1.0">   
  <title>let命令-禁止变量提升</title>   
  <script>   
    //使用var声明变量   
     console.log(x); // undefined   
     var x = 10;   
    //使用let声明变量   
     console.log(y); // Cannot access 'y' before initialization   
     let y = 20;   
   </script>   
 </head>   
 <body></body>   
 </html>  